﻿using System;
using System.Data.Linq;
using System.Transactions;
using CoreLibrary.Sql.Connection;

namespace CoreLibrary.Sql.Linq {

    public interface ILinqConnectionProvider : IConnectionProvider {

        DataContext AcquireDataContext();
        void ReleaseDataContext(DataContext context);

        void ExecuteUpdate(Action<DataContext> updateQuery);
        void ExecuteUpdate(Action<DataContext, TransactionScope> transactionalUpdateQuery);

        T ExecuteQuery<T>(Func<DataContext, T> selectQuery);
        T ExecuteQuey<T>(Func<DataContext, TransactionScope, T> transactionalSelectQuery);

    }

}